/**
 * @file drv_pwm.h
 * @brief HAL CUBEMX DRIVER
 * 
 * @author dalin (dalin@open-robot.com)
 * @version 1.0
 * @date 2023-05-10
 * 
 * @copyright Copyright (c) 2023  Open Robot Tech.co, Ltd
 * 
 * @par 修改日志:
 * <table>
 * <tr><th>Date       <th>Version <th>Author  <th>Description
 * <tr><td>2023-05-10 <td>1.0     <td>dalin     <td>内容
 * </table>
 */


#ifndef HAL_DRIVER_TIM_H
#define HAL_DRIVER_TIM_H
#include <stdint.h>
#include "drv_config.h"

#ifdef USE_TIM_PWM_DRIVER || USE_TIM_ENCODER_DRIVER
#define USE_TIM_DRIVER
#endif

#include "tim.h"

#ifdef USE_TIM_DRIVER

typedef enum TIMNUMBER_
{
    DRV_TIM_INIT = 0,
    DRV_TIM1,
    DRV_TIM2,
    DRV_TIM3,
    DRV_TIM4,
    DRV_TIM5,
    DRV_TIM6,
    DRV_TIM7,
    DRV_TIM8,
    DRV_TIM9,
    DRV_TIM10,

    DRV_TIM_NUMBER_MAX
}timNumber_e;


typedef enum TIMCHANNEL_
{
    TIM_CH1,
    TIM_CH2,
    TIM_CH3,
    TIM_CH4,
    TIM_CH_ALL,

    TIM_CH_MAX
}timChannel_e;


TIM_HandleTypeDef *  get_tim_handle(timNumber_e tim);
uint32_t  get_tim_channel(timChannel_e channel);

#endif /* USE_TIM_DRIVER */
#endif /* HAL_DRIVER_TIM_H   */
